package com.neusoft.dibuy.lib;

public class MainApp {
    /**
     * TODO Object 所有类的父类
     * 构造器重载：构造器名与类名相同，返回值类型为void，构造器可以没有返回值，也可以有返回值，但返回值类型必须与类名相同
     * 属性赋值
     * @param args
     */
    public static void main(String[] args) {
        Object o  =new Object();
        String s = new String("Ab ");
        System.out.println(s.toString());
        Animal  animal =new Animal();
        System.out.println(animal.toString());



    }
}
class  Zoo {
    Animal animal;

//    @Override
//    protected Object clone() throws CloneNotSupportedException {
////         Zoo zoo =new Zoo();
////         zoo.animal = (Animal) animal.clone();
////         return   zoo;
//    }
}


class  Animal{
    String name;

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                '}';
    }

    //    public String name;
//    public Animal(){
//
//    }
//    public Animal(String name){
//
//    }
//
//    @Override
//    protected Object clone() throws CloneNotSupportedException {
//        Animal a =  new Animal();
//        a.name =  new String(  this.name.getBytes());
//        return  a ;
//    }
}

